//
//  StateMachine.h
//  LearnObjectiveC
//
//  Created by client on 2017/9/18.
//  Copyright © 2017年 吴可高. All rights reserved.
//

#import <Foundation/Foundation.h>
#ifndef STATE_MACHINE
#define STATE_MACHINE
typedef NS_ENUM(NSInteger,SStateType){
    SSStateTypeInit,
    SSStateTypeCheckPayParameters,
    SSStateTypeCheckDeviceId
};

typedef NS_ENUM(NSInteger,SEventType){
    SSEventTypeInit,
    SSEventTypeCheckDeviceId
};
#endif

@interface StateMachine : NSObject

@property(nonatomic,assign) SStateType *stateType;
@property(nonatomic,copy) NSString * state;

+ (NSString*)getStateTypeString:(SStateType)stateType;
+ (SStateType)getStateTypeEnum:(NSString *)stateType;

+ (NSString *)getEventTypeString:(SEventType)eventType;

- (BOOL)performEventWithEventType:(SEventType)eventType;

/**
 *  初始化状态机
 */
- (void)initializeStateMachine;

/**
 *  开启状态机
 */
- (BOOL)SSEventTypeInit;

/**
 *  检测设备DeviceId
 */
- (BOOL)SSEventTypeCheckDeviceId;

@end
